import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:laos_mall/common/config/app_const.dart';
import 'package:laos_mall/common/style/app_style.dart';
import 'package:laos_mall/common/style/extension_util.dart';
import 'package:laos_mall/common/widght/appbar_widget.dart';
import 'package:laos_mall/common/widght/image_widget.dart';
import 'package:laos_mall/common/widght/list_title_widget.dart';
import 'package:laos_mall/pages/main/config.dart';

import '../../../common/widght/item_widget.dart';
import 'logic.dart';

class PointOrderDetailPage extends StatelessWidget {
  PointOrderDetailPage({Key? key}) : super(key: key);

  final logic = Get.put(PointOrderDetailLogic());

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBarWidget(text: 'points_product_details'.tr),
      body: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          ListTitleWidget(
            leading: ImageWidget(
              url: AppConst.imgUrl,
              width: 100.w,
              height: 100.w,
              fit: BoxFit.fill,
            ),
            maxLeadingW: 100.w,
            showArrow: false,
            spaceRight: 0,
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
            // crossAxisAlignment: CrossAxisAlignment.center,
            paddingOfLeft: EdgeInsets.only(right: 10.w),
            title: Text(
                "Laos Vientiane Cinema Movie ticket coupon, for watching ‘Ne Zha 2’",maxLines: 2,overflow: TextOverflow.ellipsis,),
            subtitle:        Row(children: [
              Text("${Config.symbol}400",style: AppStyle.subtitleLightStyleGray.copyWith(decoration: TextDecoration.lineThrough),),
              SizedBox(width: 17.w,),
              ItemWidget(prefixItem: Image.asset('ic_sanbin'.toImgPath(),width: 17.w,height: 17.w,),suffixItem: "999",space: 4,subtitleStyle: AppStyle.textStyle.copyWith(fontSize: 16.sp),)
            ],),

          ).addContainer(color: Colors.transparent,height: 100.w),
          SizedBox(height: 10.w,),
          ItemWidget(prefixItem: Text("pending_use".tr,style: "isExpired" == "" ? AppStyle.textSmallStyleLight : AppStyle.textSmallStyle,),suffixItem: Text("user_time".tr,style: AppStyle.textSmallStyleLightGray,),space: 14.w,),
          SizedBox(height: 20.w,),
          AppButton.sizeBtn(logic.showPointQRCode, "show_point_code".tr,size: Size(190.w, 36.w),style: AppButtonStyle.hollowBlack,textStyle: AppStyle.subtitleStyle),
          SizedBox(height: 20.w,).addDiver(),
          _buildContent('point_desc'.tr,
              Text("Elevate your fashion game with our stylish Mid-Waist Flared Jeans, perfect for creating a chic and timeless look. Designed with both comfort and style in mind, these jeans are a must-have addition to any wardrobe.", style: AppStyle.textStyleLight,)),
          _buildContent('point_rule'.tr,
              Text("Elevate your fashion game with our stylish Mid-Waist Flared Jeans, perfect for creating a chic and timeless look. Designed with both comfort and style in mind, these jeans are a must-have addition to any wardrobe.", style: AppStyle.textStyleLight,))
        ],
      ).addPadding(EdgeInsets.symmetric(horizontal: 20.w)).addSingleChildScrollView(),
    );
  }

  _buildContent(String title, Widget content) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Text(title),
        SizedBox(height: 16.h,),
        content,
      ],).addContainer(color: Colors.transparent,
        margin: EdgeInsets.only(top: 12.h),
        width: double.infinity);
  }
}
